// TOWN SPECIAL ENCOUNTERS
//    Town 42: New Cotra

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 200;
short last_abil;
short counter = 0;
short set_ter = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,);
//	add_range_to_group(,,groupn);

	set_personality_name(840,"Ostoth");
	set_personality_name(841,"Pathass");
	set_personality_name(842,"Enla");
	set_personality_name(843,"Elspeth");
	set_personality_name(844,"Nance");
	set_personality_name(845,"Crisper");
	set_personality_name(846,"Miles");
	set_personality_name(847,"Hmurrr");
	set_personality_name(848,"Gointz");
	set_personality_name(849,"Asp");
	set_personality_name(850,"Spike");
	set_name(4219,"Eric");

	set_crime_tolerance(max_crime);

	if (gf(42,9) > 0)
		set_terrain(0,22,21,0);
		
	if ((gf(42,3) > 0) && (gf(300,26) == 0)) {
		sf(42,16,1);
		erase_char(4201);
		erase_char(4202);
		}

	if (revive_party()) {
			print_str_color("Entering a friendly major city heals your wounds",2);
		print_str_color("  and restores your spell energy.",2);
		}
	break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
	if ((get_ran(1,0,100) < 10) && (gf(42,16) == 0))
		give_char_text_bubble(4213,"We can help you.");
	if ((get_ran(1,0,100) < 10) && (gf(42,16) == 0))
		give_char_text_bubble(4213,"We can make a weapon.");
	if ((get_ran(1,0,100) < 10) && (gf(42,16) == 0))
		give_char_text_bubble(4213,"Be sure before you choose.");
	if ((get_ran(1,0,100) < 10) && (gf(42,16) > 0))
		give_char_text_bubble(4213,"My allies are lost.");
	if ((get_ran(1,0,100) < 10) && (gf(42,16) > 0))
		give_char_text_bubble(4213,"Your weapon is done.");
	if ((get_ran(1,0,100) < 10) && (gf(42,16) > 0))
		give_char_text_bubble(4213,"I must recover.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4201,"Ahsss.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4201,"I bring my skilsss to the humansss.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4201,"Ostoth helpsss.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4201,"We can make a weapon.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4202,"Ostoth will aid you.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4202,"I am learning.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4202,"The vahnatai are a mystery.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4223,"So close to the surface.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4223,"I will see the sun.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4223,"I buy and sell weaponry.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4223,"Nance is in the inn.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4204,"What a surprise!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4204,"The surface explorer?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4204,"Time to return to the shop. (Sigh.)");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4205,"Ahhh! A spider!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4205,"We have a free room.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4205,"Half-off ale for heroes!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4205,"Cotra rises again!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4205,"I'm the mayor!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4206,"(Chop. Chop.)");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4206,"Phew. What a smell!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4206,"Need some potions?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4203,"Hrrrmmm.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4203,"I sell human food.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4203,"No yummy rats in my food.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4203,"Humans not like tasty things.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4208,"Hawk! Ptooo!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4208,"I sail the lake!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4208,"I'm the only sailor here!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4208,"More ale!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4221,"Hum dee dum.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4221,"I know you.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4221,"Always trying to help.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4221,"What is in there?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4210,"Meowmeowmeow.");

break;

beginstate 10;
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

beginstate 14;
break;

//	print_str("");
//	set_terrain_string_range("",1);
//	set_terrain_string_range("The sign says - .",1);

